import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
import {getAllStoreLocation} from '../api/index'

export default new Vuex.Store({
	state: {
		userInfo: {},
		storeInfo: {
			storeNo: "",
			storeName: "",
			storePhone: "",
			storeAddress: "",
			areaId: "",
			cityId: "",
			cityName: "",
			latitude: 0,
			longitude: 0,
			storeNoType: 0,
			distance: 0
		}, // 当前门店信息
		locationInfo: '定位中...', //当前定位信息
		categoryId: '', // 首页跳转到分类传递的分类 id
		productCode: '',  // 扫码获取到的条形码
	},
	mutations: {
		// 设置门店信息
		setStoreInfo(state, payload) {
			state.storeInfo = payload
		},
		// 设置定位信息
		setLocationInfo(state, payload) {
			state.locationInfo = payload
		},
		setCategoryId(state, payload) {
			state.categoryId = payload
		},
		// 设置扫码后得到的 条形码
		setProductCode(state, payload) {
			state.productCode = payload
		},
	},
	getters: {
		
	},
	actions: {
		
	}
});
